<include file="public@header"/>
<style>
    th,td{
        text-align: center;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Wuye/zuge')}">房屋列表</a></li>
        <!--<li><a href="{:url('Wuye/zuAdd')}">添加参数</a></li>-->
    </ul>
    <form id="submitForm" class="well form-inline margin-top-20" method="post" action="{:url('Wuye/zuge')}">
        分类:
        <select class="form-control" name="type" style="width: 140px;">
            <option value="">全部</option>
            <option value="chuzu">出租</option>
            <option value="chushou">出售</option>
        </select> &nbsp;&nbsp;
        关键字:
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger"  href="{:url('Wuye/zuge')}" >清空</a>
    </form>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="200">标题</th>
                <th width="200">小区名称</th>
                <th width="200">所在区域</th>
                <th width="200">价格</th>
                <th width="200">分类</th>
                <th width="200">添加时间</th>
                <th width="200">所属公众号</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <notempty name="res">
                <foreach name="res" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                   value="{$vo.id}" title="ID:{$vo.id}">
                        </td>
                        <td>{$vo.biaoti}</td>
                        <td>{$vo.xiaoqu}</td>
                        <td>{$vo.Pname}-{$vo.Cname}-{$vo.Aname}</td>
                        <td>
                            <switch name="$vo.type" >
                                <case value="chushou">{$vo.jiage}元</case>
                                <case value="chuzu">{$vo.jiage}元&nbsp;/&nbsp;月</case>
                            </switch>

                        </td>
                        <td>
                            <switch name="$vo.type" >
                                <case value="chushou">出售</case>
                                <case value="chuzu">出租</case>
                            </switch>
                        </td>
                        <td><?php echo date('Y-m-d H:i',$vo['addtime'])?></td>
                        <td>{$vo.wxName}</td>
                        <td>
                            <a href="{:url('admin/wuye/zugeadd',['id'=>$vo.id])}">编辑</a>
                            <a href="javascript:;" onclick="del({$vo.id},'rental');">删除</a>
                        </td>
                    </tr>
                </foreach>
            </notempty>
            <tfoot>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="200">标题</th>
                <th width="200">小区名称</th>
                <th width="200">所在区域</th>
                <th width="200">价格</th>
                <th width="200">分类</th>
                <th width="200">添加时间</th>
                <th width="200">所属公众号</th>
                <th width="100">操作</th>
            </tr>
            </tfoot>
        </table>
        <div class="pagination">{$page|default=''}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<script>
    function del(id,table) {
        layer.confirm('是否删除？删除之后无法恢复', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:"{:url('Wuye/del')}",
                data:{'id':id,'table':table},
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg,{icon: 6,time: 1000},function () {
                        location.reload();
                    });
                }
            });
        }, function(){

        });
    }


</script>
</body>
</html>